<template>
  <div class="noInvite">
    <van-nav-bar @click-left="$router.back()" left-arrow title="招聘" fixed>
    </van-nav-bar>
    <img src="../../assets/dafault/noinvite.png" alt="" />
    <p>当前暂无招聘内容~</p>
    <button @click="goAdd">去新建招聘</button>
  </div>
</template>

<script>
export default {
  name: "noInvite",
  data() {
    return {
      wxUserInfo: {},
      isPower: false,
    };
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {
    this.wxUserInfo = JSON.parse(sessionStorage.getItem("userWxData"));
  },
  methods: {
    //去创建
    goAdd() {
      if (this.isPower) {
        this.$router.push({ path: "/addInvite" });
      } else {
        this.$toast("您的权限不足！");
      }
    },
    //判断是否有权限创建
    async isCustomer() {
      let account = sessionStorage.getItem("agentId");
      let res = await this.$api.isCustomer({
        openId: this.wxUserInfo.openid,
        account,
        id: this.$store.state.userInfo.id,
        phone: this.$store.state.userInfo.phone,
      });
      this.isPower = res.data;
    },
  },
};
</script>
<style scoped lang='less'>
/* @import url(); 引入css类 */
.noInvite {
  text-align: center;
  img {
    margin-top: 150px;
    width: 166px;
    height: 125px;
  }
  p {
    margin-top: 23px;
    font-size: 16px;
    color: #999999;
    letter-spacing: 2px;
  }
  button {
    margin-top: 32px;
    width: 130px;
    height: 34px;
    background-color: #477fe6;
    border-radius: 17px;
    border: none;
    font-size: 13px;
    color: #ffffff;
  }
}
</style>